<jsp:useBean id="usercache" scope="session"
	class="session.cache.UserCache">
	<jsp:setProperty name="usercache"
		property="authenticationManagerPortEndpointAddress"
		value='<%= application.getInitParameter("AUTHENTICATION_MANAGER_WEB_SERVICE_URI") %>' />
</jsp:useBean>
<%
	request.setCharacterEncoding(application
			.getInitParameter("PARAMETER_ENCODING"));

	Cookie cookies[] = (request.getCookies() == null) ? new Cookie[0]
			: request.getCookies();
	Cookie tokenCookie = null;
	for (int i = 0; i < cookies.length; i++) {
		if (cookies[i].getName().compareTo("token") == 0) {
			tokenCookie = cookies[i];
		}
	}

	if (tokenCookie != null) {
		usercache.updateUserCache(Integer.parseInt(tokenCookie
				.getValue()));
	} else {
		usercache.resetChace();
	}
%>